<%@page import="java.util.*"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<% String path = request.getContextPath();
	String basePath = request.getScheme()+"://" +request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<base href="<%=basePath%>"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link href="css/backstyle.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="js/jquery-1.8.2.js"></script>
	<script type="text/javascript" src="js/getParentType.js"></script>
	<script type="text/javascript">
		$(function (){
			var type1 = ${requestScope.product.type1};
			var type2 = ${requestScope.product.type2};
			//初始化大小类并选中
			initType1Type2(type1,type2);
			//给大类绑定改变事件,大类改变后，找出对应的小类
			$("#option").change(function (){
				//获得大类改变后的值
				var id = $(this).val();
				//根据大类查找小类
				getParentChildren(id)
			})
		})
	</script>
</head>
<body>

	<div class="place">
    <span>位置：</span>
    <ul class="placeul">
    <li><a href="#">首页</a></li>
    <li><a href="#">表单</a></li>
    </ul>
    </div>
    
    <div class="formbody">
    
    <div class="formtitle"><span>修改商品信息</span></div>
    <form method="post"  enctype="multipart/form-data" action="ProductController/updateProduct">
    	<input type="hidden" name="id" value="${requestScope.product.id}"/>
    	<ul class="forminfo">
	   		<li><label>商品名称</label><input name="name" value="${requestScope.product.name}"  type="text" class="dfinput" /><i>标题不能超过30个字符</i></li>
	    	<li><label>所属大类</label><select name="type1" id="option"></select></li>
			<li><label>所属小类</label><select name="type2" id="option2"></select></li>
			<li><label>商品状态</label><select name="statu" id="statu"><option value="1">上架中</option><option value="0">已录入</option><option value="-1">已下架</option></select>
			<li><label>商品价格</label><input name="price" type="text" class="dfinput" value="${requestScope.product.price}"/></li>
			<li><label>商品库存</label><input name="stock" type="text" class="dfinput" value="${requestScope.product.stock}"/></li>
			<li><label>更换图片</label><input name="pngUrl" type="file"/></li>
			<li><label>商品图片</label><img src="/images/${requestScope.product.pngUrl}" width="350px" height="250px"></li>
			<li><label>商品描述</label><textarea rows="8" cols="40" name="des"  >${requestScope.product.des}</textarea></li>
	    	<li><label>&nbsp;</label><input name="" type="submit" class="btn" value="确认保存"/></li>
	    </ul>
    
    </form>
    </div>
<div style="display:none"><script src='http://v7.cnzz.com/stat.php?id=155540&web_id=155540' language='JavaScript' charset='gb2312'></script></div>
</body>
</html>

